package com.openway.game.view.impl;

import com.openway.game.Game;
import com.openway.game.personage.GameObject;
import com.openway.game.view.AbstractPseudoGraphView;

import java.io.IOException;

/**
 * Pseudo-graph view implementation that displays the state of the game on the console.
 *
 * @author Created: 29.02.12 15:29
 * @version $Date$ $Revision$
 */
public class PseudoGraphConsoleView extends AbstractPseudoGraphView {

    @Override
    public void render() throws IOException {
        System.out.println(getDescription());
        for (GameObject[] row : Game.getInstance().getPlayingField().getFieldSnapshot()) {
            for (GameObject gameObject : row) {
                System.out.print(getObjectSymbol(gameObject) + " ");
            }
            System.out.println();
        }
    }
}
